home *** CD-ROM | disk | FTP | other *** search
/ macdrivermuseum.net / www.macdrivermuseum.net.tar / www.macdrivermuseum.net / nic / daynaccard121.sit / communicard installer 1.2.1 mac / CommuniCard Installer 1.2.1 / Dayna CommuniCard_C < prev    next >
Text File  |  1995-10-11  |  8KB  |  367 lines

  1. !  Dayna CommuniCard 1.1
  2. !
  3. !  'mlts' resource info for this modem:
  4. !    byte 1 == 01 -> modem HAS builtin reliability protocols
  5. !    byte 2 == 00 -> reserved by Apple
  6. !    byte 3 == FF -> max hex chars in varstr 7 (255 dec)
  7. !    byte 4 == 00 -> max hex chars in varstr 8
  8. !    byte 5 == 00 -> max hex chars in varstr 9
  9. !
  10. @ORIGINATE
  11. @ANSWER
  12. !
  13. ! Set up the modem - label range is 1-10
  14. !
  15. ! Mac talks to the modem at 38,400 bps.  
  16. serreset 38400, 0, 8, 1
  17. !
  18. ! reset the serial port handshake options
  19. HSReset 0 1 0 0 0 0
  20. !
  21. settries 0
  22. @LABEL 1
  23. flush
  24. matchclr
  25. matchstr 1 3 "OK\13\10"
  26. ! &F    - recall factory settings
  27. ! &K3   - Enable CTS/RTS Hardware flow control (Set by AT&F)
  28. ! W2    - gives Connect with DTE result codes 
  29. ! X4    - Use extended result codes (Set by AT&F) 
  30. ! &Q6   - Disable auto port rate adjust 
  31. ! &Q6   - Use asynch mode (no reliability protocols) (Same as above)
  32. ! S46=136 - No compression
  33. ! Y1    - Disconnect on Long Break
  34. ! S7=60 - To allow for an international call
  35. ! S0=0  - Don't answer calls (Set by AT&F) 
  36. ! E0    - Turn command echo off
  37. write "AT&FE0W2&Q6Y1S7=60S46=136\13"
  38. matchread 30
  39. inctries
  40. iftries 2 71
  41. ! Modem not responding, send long break.
  42. LBreak
  43. jump 1
  44. !
  45. @LABEL 3
  46. ! Modem responding & configured.
  47. ! Determine if reliable link is requested.
  48. !
  49. ! If modem mnp10 link requested (var 4 == 2) then jump label 4
  50. ! If modem v42 link requested (var 4 == 1) then jump label 5
  51. ! If no modem v42 link requested (var 4 == 0) [same as ARA 1.0] then jump label 9
  52. !
  53. ifstr 4 4 "2"
  54. ifstr 4 5 "1"
  55. ifstr 4 9 "0"
  56. !
  57. ! Else invalid value in var 4, exit with error
  58. jump 76
  59. !
  60. @LABEL 4
  61. ! MNP10 reliable modem link is requested
  62. !
  63. matchclr
  64. matchstr 1 7 "OK\13\10"
  65. ! \N2 - MNP reliable mode 
  66. ! -K1 - enables V.42 LAPM to MNP10 conversion
  67. ! )M1 - enable power level adjustment
  68. ! *H1 - link negotiation occurs at 1200
  69. write "AT\\N2-K1)M1*H1\13"
  70. matchread 300
  71. jump 71
  72. !
  73. @LABEL 5
  74. ! Reliable link is requested.  OK for LAP-M -> MNP 4.
  75. matchclr
  76. matchstr 1 7 "OK\13\10"
  77. ! W2    - gives Connect with DTE result codes
  78. ! &Q5   - v42 autoreliable mode
  79. ! S48=7 - Protocol negotiation on
  80. ! S36=7 - LAPM, then MNP4, then Asynch with constant DTE speed
  81. ! S46=136 - Compression  (LZW/v42bis, MNP 5, ATC) disabled
  82. write "ATW2&Q5S48=7S36=7S46=136\13"
  83. matchread 300
  84. jump 71
  85. !
  86. @LABEL 7
  87. ! If we DID support v42b in the modem, this is where it would go.
  88. !
  89. @LABEL 9
  90. ! If speaker on flag is true, jump to label 13.  Else turn off the speaker.
  91. ifstr 2 13 "1"
  92. pause 5
  93. matchclr
  94. matchstr 1 13 "OK\13\10"
  95. write "ATM0\13"
  96. matchread 30
  97. jump 71
  98. !
  99. ! Modem ready, so enable answer or dial mode - label range is 11-30
  100. ! Determine if answer or originate mode.
  101. !
  102. @LABEL 13
  103. pause 5
  104. ifANSWER 62
  105. !
  106. ! Dial type dispatch
  107. !
  108. ! Normal dialing (parm 6 == 0) jump to 19
  109. ! Blind  dialing (parm 6 == 1) jump to 17
  110. ! Manual dialing (parm 6 == 2) jump to 15 
  111. !
  112. ifstr 6 19 "0"
  113. ifstr 6 17 "1"
  114. ifstr 6 15 "2"
  115. !
  116. ! Else invalid value in var 6, exit with error
  117. jump 76
  118. !
  119. @label 15
  120. note "Manual dialing initiated..." 3
  121. ! X1 - ignore dialtone and busy for manual dialing, D to dial
  122. write "ATX1D \13"
  123. jump 32
  124. !
  125. @label 17
  126. note "Dialing without dialtone." 3
  127. matchclr
  128. matchstr 1 19 "OK\13\10"
  129. ! X3 - ignore dialtone but report busy for blind dialing
  130. write "ATX3\13"
  131. matchread 30
  132. jump 71
  133. !
  134. ! This is where we break up long dialstrings.
  135. ! This modem has a 255 chars command buffer and dial string
  136. ! fragmentation is not supported by Hayes.
  137. ! Labels 19 - 27 reserved. 
  138. !
  139. @label 19
  140. ! Parameter 1 contains the full dialstring from the connection document.
  141. ! Parameter 3 contains "P" for pulse & "T" for tone dialing.
  142. ! Parameter 7, 8 & 9 contain the dial string fragments.
  143. !
  144. note "Dialing ^1." 3
  145. write "ATD^3^7\13"
  146. jump 32
  147. !
  148. !    Connecting - label range is 31-60
  149. !
  150. @LABEL 32
  151. matchclr
  152. !
  153. matchstr 1 68 "RING\13\10"
  154. matchstr 2 72 "NO DIALTONE\13\10"
  155. matchstr 3 73 "NO CARRIER\13\10"
  156. matchstr 4 73 "ERROR\13\10"
  157. matchstr 5 74 "BUSY\13\10"
  158. matchstr 6 75 "NO ANSWER\13\10"
  159. !
  160. matchstr 7  34 "CONNECT 1200\13\10"
  161. matchstr 8  34 "CONNECT 1200/REL\13\10"
  162. matchstr 9  35 "CONNECT 2400\13\10"
  163. matchstr 10  35 "CONNECT 2400/REL\13\10"
  164. matchstr 11  36 "CONNECT 4800\13\10"
  165. matchstr 12  36 "CONNECT 4800/REL\13\10"
  166. matchstr 13  37 "CONNECT 7200\13\10"
  167. matchstr 14  37 "CONNECT 7200/REL\13\10"
  168. matchstr 15  38 "CONNECT 9600\13\10"
  169. matchstr 16  38 "CONNECT 9600/REL\13\10"
  170. matchstr 17  39 "CONNECT 12000\13\10"
  171. matchstr 18  39 "CONNECT 12000/REL\13\10"
  172. matchstr 19  40 "CONNECT 14400\13\10"
  173. matchstr 20  40 "CONNECT 14400/REL\13\10"
  174. matchstr 21  41 "CONNECT 16800\13\10"
  175. matchstr 22  41 "CONNECT 16800/REL\13\10"
  176. matchstr 23  42 "CONNECT 19200\13\10"
  177. matchstr 24  42 "CONNECT 19200/REL\13\10"
  178. matchstr 25  43 "CONNECT 21600\13\10"
  179. matchstr 26  43 "CONNECT 21600/REL\13\10"
  180. matchstr 27  44 "CONNECT 24000\13\10"
  181. matchstr 28  44 "CONNECT 24000/REL\13\10"
  182. matchstr 29  45 "CONNECT 26400\13\10"
  183. matchstr 30  45 "CONNECT 26400/REL\13\10"
  184. matchstr 31  46 "CONNECT 28800\13\10"
  185. matchstr 32  46 "CONNECT 28800/REL\13\10"
  186. !
  187. matchread 700
  188. ! If in ANSWER mode, loop back.
  189. ! Else in ORIGINATE mode, the modem has timed out.
  190. ifANSWER 32
  191. jump 71
  192. !
  193. !  This modem has been setup to do CTS handshaking,
  194. !  and we assume that a CTS handshaking cable is being used,
  195. !  so we leave the serial port set to 38400 bps.
  196. !  
  197. @LABEL 34
  198. note "Communicating at 1200 bps." 2
  199. CommunicatingAt 1200
  200. jump 58
  201. !
  202. @LABEL 35
  203. note "Communicating at 2400 bps." 2
  204. CommunicatingAt 2400
  205. jump 58
  206. !
  207. @LABEL 36
  208. note "Communicating at 4800 bps." 2
  209. CommunicatingAt 4800
  210. jump 58
  211. !
  212. @LABEL 37
  213. note "Communicating at 7200 bps." 2
  214. CommunicatingAt 7200
  215. jump 58
  216. !
  217. @LABEL 38
  218. note "Communicating at 9600 bps." 2
  219. CommunicatingAt 9600
  220. jump 58
  221. !
  222. @LABEL 39
  223. note "Communicating at 12000 bps." 2
  224. CommunicatingAt 12000
  225. jump 58
  226. !
  227. @LABEL 40
  228. note "Communicating at 14400 bps." 2
  229. CommunicatingAt 14400
  230. jump 58
  231. !
  232. @LABEL 41
  233. note "Communicating at 16800 bps." 2
  234. CommunicatingAt 16800
  235. jump 58
  236. !
  237. @LABEL 42
  238. note "Communicating at 19200 bps." 2
  239. CommunicatingAt 19200
  240. jump 58
  241. !
  242. @LABEL 43
  243. note "Communicating at 21600 bps." 2
  244. CommunicatingAt 21600
  245. jump 58
  246. !
  247. @LABEL 44
  248. note "Communicating at 24000 bps." 2
  249. CommunicatingAt 24000
  250. jump 58
  251. !
  252. @LABEL 45
  253. note "Communicating at 26400 bps." 2
  254. CommunicatingAt 26400
  255. jump 58
  256. !
  257. @LABEL 46
  258. note "Communicating at 28800 bps." 2
  259. CommunicatingAt 28800
  260. jump 58
  261. !
  262. @LABEL 58
  263. ! Add 5 second delay to insure compatibility with ARA 2.0.1.
  264. ! Each unit in the CCL is 1/10th of a second.
  265. pause 50
  266. !
  267. ifANSWER 59
  268. pause 30
  269. !
  270. @LABEL 59
  271. exit 0
  272. !
  273. ! @ANSWER
  274. ! Set the modem to answer on 1st ring - label range is 61-70
  275. !
  276. @LABEL 62
  277. matchclr
  278. ! On match jump to MODEM STATUS and wait for RING
  279. matchstr 1 32 "OK\13\10"
  280. write "ATS0=1\13"
  281. matchread 30
  282. jump 71
  283. !
  284. ! RING entry point
  285. ! If ORIGINATE mode return to waiting for input.
  286. ! Else claim the serial port and return.
  287. !
  288. @LABEL 68
  289. ifORIGINATE 32
  290. userhook 1
  291. note "Answering call..." 2
  292. jump 32
  293. !
  294. ! Error messages - label range is 71-100
  295. !
  296. ! Modem Not Responding
  297. @LABEL 71
  298. exit -6019
  299. !
  300. ! No Dialtone
  301. @LABEL 72
  302. exit -6020
  303. !
  304. ! No Carrier or Error
  305. @LABEL 73
  306. exit -6021
  307. !
  308. ! Busy
  309. @LABEL 74
  310. exit -6022
  311. !
  312. ! No Answer
  313. @LABEL 75
  314. exit -6023
  315. !
  316. ! Invalid Varstring Value
  317. @LABEL 76
  318. exit -6027
  319. !
  320. ! Hang up the modem - label range is 101-120
  321. !
  322. @HANGUP
  323. !
  324. @LABEL 102
  325. flush
  326. settries 0
  327. HSReset 0 1 0 0 0 0
  328. !
  329. @LABEL 105
  330. ! Drop the modem into command mode with escape sequence.
  331. ! Then tell modem to hangup.
  332. ! Repeat hangup command and escape sequence 3 times max.
  333. !
  334. flush
  335. matchclr
  336. matchstr 1 108 "OK\13\10"
  337. pause 10
  338. write "+++"
  339. matchread 15
  340. !
  341. @LABEL 108
  342. matchclr
  343. matchstr 1 111 "NO CARRIER\13\10"
  344. matchstr 2 111 "OK\13\10"
  345. matchstr 3 111 "ERROR\13\10"
  346. write "ATH0\13"
  347. matchread 30
  348. inctries
  349. iftries 3 71
  350. jump 105
  351. !
  352. ! recall the factory setting.
  353. !
  354. @LABEL 111
  355. pause 15
  356. matchclr
  357. matchstr 1 114 "OK\13\10"
  358. write "AT&F\13"
  359. matchread 30
  360. jump 71
  361. !
  362. @LABEL 114
  363. exit 0
  364. !
  365. ! Labels 121-128 are reserved for future emergency hacks.
  366. !
  367.